package com.sg.dto.integration.app;

import com.sg.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Objects;

/**
 * @desc OneTargetCycleWeightDto
 * @使用场景
 */
@Data
public class OneTargetCycleWeightDto extends BaseDto implements Serializable {

    /**
     * 对象目标周期权重设置ID
     */
    @ApiModelProperty("对象目标周期权重设置ID")
    private String objTargetCycleWeightSetId;

    /**
     * 被评对象目标周期ID
     */
    @ApiModelProperty("被评对象目标周期ID")
    private String evaObjTargetCycleId;

    /**
     * 权重分值
     */
    @ApiModelProperty("权重分值")
    private Double weightScore;

    /**
     * 权重
     */
    @ApiModelProperty("权重")
    private Double weightValue;

    /**
     * 父子中周期类型 PARENT_CYCLE:父周期 SUB_CYCLE:子周期 MID_CYCLE:中期
     */
    @ApiModelProperty("父子中周期类型")
    private String parentSubMidCycleType;

    /**
     * 相对上级排序
     */
    @ApiModelProperty("相对上级排序")
    private Long relativeOrderNumber;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        OneTargetCycleWeightDto that = (OneTargetCycleWeightDto) o;
        return (
                objTargetCycleWeightSetId == that.objTargetCycleWeightSetId &&
                        evaObjTargetCycleId == that.evaObjTargetCycleId &&
                        weightScore == that.weightScore &&
                        weightValue == that.weightValue &&
                        parentSubMidCycleType == that.parentSubMidCycleType &&
                        relativeOrderNumber == that.relativeOrderNumber
        );
    }

    @Override
    public int hashCode() {
        return Objects.hash(
                super.hashCode(),
                objTargetCycleWeightSetId,
                evaObjTargetCycleId,
                weightScore,
                weightValue,
                parentSubMidCycleType,
                relativeOrderNumber
        );
    }

}
